package com.chb.composite;

/**
 * @author chihb
 * @create-time 2024/10/23 20:47
 * @description
 */
public class MenuItem extends MenuComponent{
    public MenuItem(String name, int level){
        this.name = name;
        this.level = level;
    }

    @Override
    void print() {
        for (int i = 1; i < level; i++) {
            System.out.print("--");
        }
        System.out.println(name);
    }
}
